import { ObjCreate } from "../../../common/ObjCreate";
import { PetProcessBar } from "../../../pet/PetProcessBar";
import { EDominionCountryForce } from "../../../../../../Message/Public/EDominionCountryForce";
import { ImagesConst } from "../../../../resource/ImagesConst";
import { DomWarConst } from "../../DomWarConst";
import { GTextFiled } from "../../../../../../com/mui/controls/GTextFiled";
import { YellowBar10 } from "../../../../../../ImagesConst/YellowBar10";
import { BlueBar10 } from "../../../../../../ImagesConst/BlueBar10";
import { PurpleBar10 } from "../../../../../../ImagesConst/PurpleBar10";
type int = number;
//class CampForceBarCellRender
    
    export  class CampForceBarCellRender /* flash.display.Sprite */
    {
        

        public get data(): Object
        {
            return this._data;
        }

        public set data(arg1: Object)
        {
            var loc1=0;
            var loc2=null;
            if (arg1 == null) 
            {
                return;
            }
            this._data = arg1;
            loc1 = arg1.camp;
            if (!this._isCreateUI) 
            {
                this._isCreateUI = true;
                loc2 = this.getInfo(loc1);
                this._campTxt = ObjCreate.createGTextField("", 0, 0, 100, 20, this);
                this._campTxt.autoSize = "left";
                this._campTxt.text = loc2.name + ":";
                this._progressBar = new PetProcessBar(loc2.barName, 143, 12);
                this._progressBar.x = 45;
                this._progressBar.y = 5;
                this.addChild(this._progressBar);
                this._progressBar.drawNow();
            }
            this._progressBar.setValue(this._data.num, this._data.max);
            return;
        }

        /* internal  */getInfo(arg1: int): Object
        {
            var loc1={};
            var loc2=arg1;
            switch (loc2) 
            {
                case EDominionCountryForce._EDominionForceImmortal:
                {
                    loc1 = {"barName": YellowBar10};
                    break;
                }
                case EDominionCountryForce._EDominionForceHumanWorld:
                {
                    loc1 = {"barName": BlueBar10};
                    break;
                }
                case EDominionCountryForce._EDominionForceDevil:
                {
                    loc1 = {"barName": PurpleBar10};
                    break;
                }
            }
            loc1.name = DomWarConst.getCampName(arg1);
            return loc1;
        }

        /* internal */ /* var */_campTxt: GTextFiled;

        /* internal */ /* var */_progressBar: PetProcessBar;

        /* internal */ /* var */_isCreateUI: Boolean;

        /* internal */ /* var */_data: Object;
    }
